package com.hgyc.mom.eam.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hgyc.mom.common.vo.Result;
import com.hgyc.mom.core.mybatis.QueryWrapperUtil;
import com.hgyc.mom.eam.entity.EamEquipmentRepairReport;
import com.hgyc.mom.eam.service.EamEquipmentRepairReportService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 设备维修报告Controller
 *
 * @author fwj
 * @since 2025-08-19
 */
@Tag(name = "设备维修报告控制器", description = "设备维修报告控制器")
@RestController
@RequestMapping("/eam/repair/report")
public class EamEquipmentRepairReportController {
    @Autowired
    private EamEquipmentRepairReportService eamEquipmentRepairReportService;

    @Operation(summary = "获取设备维修报告详细信息", description = "获取设备维修报告详细信息")
    @GetMapping(value = "/{id}")
    public Result<EamEquipmentRepairReport> getInfo(@Parameter(description = "设备维修报告ID") @PathVariable("id") Long id) {
        return Result.success(eamEquipmentRepairReportService.getById(id));
    }

    @Operation(summary = "获取设备维修报告详细信息", description = "获取设备维修报告详细信息")
    @GetMapping(value = "/parent/{id}")
    public Result<EamEquipmentRepairReport> getInfoByParent(@Parameter(description = "设备维修单ID") @PathVariable("id") Long id) {
        return Result.success(eamEquipmentRepairReportService.getByParentId(id));
    }

}
